import { GetServerSideProps, NextPage, PageConfig } from 'next';
import Head from 'next/head';
import Lzqlist from './lzqlist';
import { Query as Q1 } from '../api/class/lzqsearch.api';
import { tbclass } from '../../atoms/db';
import api from '../../atoms/api';


interface IProps {
	query: Q1;
}
/**
 * 班级管理
 */
const Page: NextPage<IProps> = ({ query }) => {
	return (
		<>
			<Head>
				<title>班级管理</title>
			</Head>
			<Lzqlist initialquery={query} />

		</>
	);
};

export const config: PageConfig = {
	amp: false
};

export default Page;

// pre-render this page on each request
export const getServerSideProps: GetServerSideProps<IProps> = async (context) => {
	const query = context.query as Record<string, string>;
	return {
		props: {
			query: {
				page: query.page || '1',
				pagesize: '10',
				q: query.q || ''
			}

		}
	};
};
